alter table SentEmailsHistory add IsContactInfoAttached bit null
go

update SentEmailsHistory set
  IsContactInfoAttached = 0
go

alter table SentEmailsHistory alter column IsContactInfoAttached bit not null
go

alter table SentEmailsHistory add VacancyId int null
go

alter table SentEmailsHistory add constraint FK_SentEmailsHistory_Vacancies_VacancyId 
      foreign key (VacancyId) references Vacancies(Id) on delete cascade
go

update [dbo].[SentEmailsHistory] set
  [SendDate] = cast([SendDate] as date)
go